package com.danco.training.bookshop.entity.storage;


import java.io.Serializable;

import com.danco.training.bookshop.service.storage.BookStorageService;
import com.danco.training.bookshop.service.storage.ClaimStorageService;
import com.danco.training.bookshop.service.storage.OrderStorageService;
import com.danco.training.serialization.FileLoaderUtil;

public class Bookshop implements Serializable{


	
	/**
	 * 
	 */
	private static final long serialVersionUID = -2386224790479557201L;
	
	private BookStorageService bookStorageService;
	private OrderStorageService orderStorageService;
	private ClaimStorageService claimStorageService;
	
	
	
	private static Bookshop bookshopInstance = (Bookshop) FileLoaderUtil.load();

	private Bookshop() {
		
		bookStorageService = BookStorageService.getBookStorageSeviceInstance();
		orderStorageService = OrderStorageService.getOrderStorageServiceInstance();
		claimStorageService = ClaimStorageService.getClaimStorageServiceInstance();
		
	}

	public BookStorageService getBookStorageService() {
		return bookStorageService;
	}

	public void setBookStorageService(BookStorageService bookStorageService) {
		this.bookStorageService = bookStorageService;
	}

	public OrderStorageService getOrderStorageService() {
		return orderStorageService;
	}

	public void setOrderStorageService(OrderStorageService orderStorageService) {
		this.orderStorageService = orderStorageService;
	}

	public ClaimStorageService getClaimStorageService() {
		return claimStorageService;
	}

	public void setClaimStorageService(ClaimStorageService claimStorageService) {
		this.claimStorageService = claimStorageService;
	}

	public static Bookshop getBookshopInstance() {
		if (bookshopInstance == null){
			bookshopInstance = new Bookshop();
		}
		return bookshopInstance;
	}

		
	
}